﻿using Microsoft.Reporting.WebForms;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace YERIL_PI_INT.PaginasWebs.Modulos.Login
{
    public partial class REPT_TOT_PROY_BY_CLIENTE : System.Web.UI.Page
    {

        int Cliente = 0;

        protected void Page_Load(object sender, EventArgs e)
        {
            Cliente = Convert.ToInt32(Session["Cliente"]);
            //Cliente = Convert.ToInt32(Request.QueryString["Cliente"]);
            WSGestion.WSGestion wsgest = new WSGestion.WSGestion();
            wsgest.Url = ConfigurationManager.AppSettings.Get("dirWs");

            if (!IsPostBack)
            {
                DataTable dt = wsgest.Rep_Proy_By_Cli(Cliente);
                ReportViewer1.ProcessingMode = ProcessingMode.Local;
                LocalReport localReport = ReportViewer1.LocalReport;

                localReport.ReportPath = "REP_TOT_PROY_BY_CLIENTE.rdlc";

                ReportDataSource ds = new ReportDataSource();
                ds.Name = "dsREP_TOT_PROY_BY_CLIENTE"; // nombre del asistente para informes
                ds.Value = dt;
                ReportViewer1.LocalReport.DataSources.Clear();

                localReport.DataSources.Add(ds);

            }
        }
    }
}